Skip to content

Postgresql mapping context#2313

Merged
norberttech merged 3 commits into1.xfrom
postgresql-mapping-context
Apr 19, 2026
Merged

Postgresql mapping context#2313
norberttech merged 3 commits into1.xfrom
postgresql-mapping-context

Conversation

@norberttech
Copy link
Copy Markdown
Member

Change Log


Added

  • Context to PostgreSql RowMapper
  • StaticFactory row mapper implementation for PostgreSql Client
  • Custom context to PostgreSql Client - supported by Symfony Bundle

Fixed

Changed

Removed

Deprecated

Security

- context that carry client / catalog / query / parametes
- also client now gets his own context that can be merged with row
mapper context
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 97.97297% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.26%. Comparing base (be4bb3c) to head (30328b1).
⚠️ Report is 2 commits behind head on 1.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              1.x    #2313      +/-   ##
==========================================
+ Coverage   84.04%   84.26%   +0.21%     
==========================================
  Files        1530     1535       +5     
  Lines       57705    57829     +124     
==========================================
+ Hits        48501    48728     +227     
+ Misses       9204     9101     -103     
Components Coverage Δ
etl 90.62% <ø> (+0.85%) ⬆️
cli 85.76% <ø> (ø)
lib-array-dot 94.82% <ø> (ø)
lib-azure-sdk 60.15% <ø> (ø)
lib-doctrine-dbal-bulk 95.16% <ø> (ø)
lib-filesystem 83.78% <ø> (ø)
lib-types 89.27% <ø> (+1.50%) ⬆️
lib-parquet 70.18% <ø> (ø)
lib-parquet-viewer 83.04% <ø> (ø)
lib-snappy 90.65% <ø> (ø)
lib-dremel 0.00% <ø> (ø)
lib-postgresql 88.66% <100.00%> (+0.04%) ⬆️
lib-telemetry 89.57% <ø> (ø)
bridge-filesystem-async-aws 92.01% <ø> (ø)
bridge-filesystem-azure 90.65% <ø> (ø)
bridge-monolog-http 97.45% <ø> (ø)
bridge-openapi-specification 91.50% <ø> (ø)
symfony-http-foundation 74.11% <ø> (ø)
bridge-psr18-telemetry 100.00% <ø> (ø)
bridge-psr7-telemetry 100.00% <ø> (ø)
bridge-telemetry-otlp 89.29% <ø> (+0.25%) ⬆️
bridge-symfony-http-foundation-telemetry 88.23% <ø> (ø)
bridge-symfony-filesystem-bundle 96.84% <ø> (ø)
bridge-symfony-postgresql-bundle 95.42% <93.18%> (-0.12%) ⬇️
bridge-symfony-postgresql-messenger 99.59% <ø> (ø)
bridge-symfony-telemetry-bundle 67.60% <ø> (ø)
adapter-chartjs 84.72% <ø> (ø)
adapter-csv 88.65% <ø> (ø)
adapter-doctrine 92.00% <ø> (ø)
adapter-elasticsearch 92.78% <ø> (ø)
adapter-google-sheet 99.02% <ø> (ø)
adapter-http 67.91% <ø> (ø)
adapter-json 87.61% <ø> (ø)
adapter-logger 47.36% <ø> (ø)
adapter-parquet 78.89% <ø> (ø)
adapter-text 81.25% <ø> (ø)
adapter-xml 82.07% <ø> (ø)
adapter-avro 0.00% <ø> (ø)
adapter-excel 94.02% <ø> (ø)
adapter-postgresql 0.00% <ø> (ø)
bridge-phpunit-postgresql 72.97% <100.00%> (ø)
bridge-phpunit-telemetry 48.14% <ø> (ø)
bridge-postgresql-valinor 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +22 to +29
?Query $query = null,
?Client $client = null,
?ClientContext $clientContext = null,
) : Context {
return new Context(
$query ?? new Query('SELECT 1'),
$client ?? new StubClient(),
$clientContext ?? new ClientContext(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
?Query $query = null,
?Client $client = null,
?ClientContext $clientContext = null,
) : Context {
return new Context(
$query ?? new Query('SELECT 1'),
$client ?? new StubClient(),
$clientContext ?? new ClientContext(),
Query $query = new Query('SELECT 1'),
Client $client = new StubClient(),
ClientContext $clientContext = new ClientContext(),
) : Context {
return new Context(
$query,
$client,
$clientContext,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's cosmetic, irrelevant, if anything maybe rector could enforce the style here but in general there are places among the codebase that does the same

);
}

public static function with(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also by default any() and with() do the same.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes and no, difference between with and any is that any should be used in the tests that arguments doesn't matter as they are not being used in the assertions.
With on the other hand should be used when arguments are in some way relevant to the test, but since not all of them always are required, for simplicity with takes all arguments optional

{
return new self(
catalog: $other->catalog ?? $this->catalog,
data: \array_replace($this->data, $other->data),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure it should do replace? Method says merge.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thats what array_replace does:

array_replace() creates a new array and assigns items into it for each key in each of the provided arrays. If a key appears in multiple input arrays, the value from the right-most input array will be used.

@norberttech norberttech merged commit a1b9853 into 1.x Apr 19, 2026
32 checks passed
@norberttech norberttech deleted the postgresql-mapping-context branch April 19, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants